import Vue from "vue";
import ElementUI from "element-ui";
// import "./theme/variables.css"
import "./theme/index.scss";
import App from "./App.vue";
import "normalize.css/normalize.css";
import VueCookie from "vue-cookies";
import Storage from "./libs/storage";
import store from "./store";
import router from "./router";
import { tools } from "./libs/util";
import moment from "moment";
import NProgress from "nprogress";
import "nprogress/nprogress.css";
import DandelionUi from 'dandelion-ui'
import 'dandelion-ui/lib/style/index.css'

import md5 from "js-md5";
import Print from "./libs/print.js"
import * as echarts from 'echarts' // 图表插件
import "./assets/iconfont/iconfont.js";
import "./assets/iconfont/iconfont.css";
import IconSvg from "@components/nr/icon/Index";
import eIconPicker from "e-icon-picker";
import Defaults from "@/libs/defaults";
import useMock from "@/api/mock";
import Menu from "@menu";
import _ from "lodash";
import "./libs/rem.js";
import "./libs/directives.js"

import BaiduMap from 'vue-baidu-map'
Vue.use(BaiduMap, {
  ak: "HrbGSuCiTDInks4ZclYzCzsjoK7dp7GM"
})
import * as fundebug from "fundebug-javascript";
import FundebugVue from "fundebug-vue";

fundebug.init({
  apikey: "99d7906655f5d513f2d254a669daa41633f662f33f4d44b8fc783e103b7f626b"
})
new FundebugVue(fundebug).installVueErrorHandler(Vue);

// FIXME: 开启mock后，部分请求被mock拦截，开发人员需要注意
useMock();
// 项目默认设置
Vue.use(Defaults);
//全局删除增加图标
Vue.use(
  eIconPicker
);

Vue.use(DandelionUi)

window.gitRevision = process.env.gitRevision;
window._ = _;

window.testObject = {
  a: {
    b: {
      name: "name"
    }
  }
}

Vue.component("icon-svg", IconSvg);
// 进度条动画配置
NProgress.configure({
  showSpinner: false, // 是否显示加载ico
  easing: "ease",
  speed: 500,
  trickleSpeed: 200,
  minimum: 0.3
});

Vue.config.productionTip = false;
Vue.config.devtools = true;
Vue.use(Print);
Vue.use(ElementUI, { size: "small" });
Vue.use(VueCookie);
Vue.use(Storage);
Vue.use(Menu);

Vue.prototype.$moment = moment;
Vue.prototype.$tools = tools; // 定义tools为vue的默认属性
Vue.prototype.$processEnvUrl = process.env.VUE_APP_URL;

const isTestEnvironment = process.env.NODE_ENV === 'test' || process.env.NODE_ENV === 'pre' || process.env.NODE_ENV === 'development'
Vue.prototype.$isTestEnvironment = isTestEnvironment

Vue.prototype.$md5 = md5;
Vue.prototype.$echarts = echarts
Vue.prototype.bus = new Vue();

new Vue({
  router,
  store,
  mounted () { },
  render: (h) => h(App)
}).$mount("#app");
